UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cj3y3yAKPDlGqRPQU9wWwjwoL0634qVHXEAkfnkccCw=' 
WHERE 
  key_id = '26ee29a84428db1af68039b23c39972ba474c12aaf9598b5ac93514c6f7e7275' 
  AND (
    token = 'cj3y3yAKPDlGqRPQU9wWwjwoL0634qVHXEAkfnkccCw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035