UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Phe1FOfjiECYcs+QBU5QcKl4iKS/HrCxacJJhuWuYEA=' 
WHERE 
  key_id = 'fbc1ed3010455c40546666743701dbb6c0e60ed2edf498c6f8c696b7776bb6db' 
  AND (
    token = 'Phe1FOfjiECYcs+QBU5QcKl4iKS/HrCxacJJhuWuYEA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039