UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lxaUAlT3oqISLIoLtRMsl1NOBjhXRJkElRL7p7G0lCc=' 
WHERE 
  key_id = '4c73d329f3453f57f03fb5807e5604010884620fa2ddfd736664ed37d2ae33e5' 
  AND (
    token = 'lxaUAlT3oqISLIoLtRMsl1NOBjhXRJkElRL7p7G0lCc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042