UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '11/0v1QHAzFIr5K+N226QIY1Cepku0e2L5vhzcijK6w=' 
WHERE 
  key_id = '482e76cbf1c929b86a43cf2cd75f1c7fa21062c046387190565b0446c1d0290f' 
  AND (
    token = '11/0v1QHAzFIr5K+N226QIY1Cepku0e2L5vhzcijK6w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029