UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QkFdlNTX9togdj3FCS8/641dn2E5ge7gxn6TaQxWqeg=' 
WHERE 
  key_id = '56ab36f89e6ca8bdfd9c4f05bcdc9a17ce8ca3f138e4522b9b10ff57fb28fa2a' 
  AND (
    token = 'QkFdlNTX9togdj3FCS8/641dn2E5ge7gxn6TaQxWqeg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041