UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zvoh/XuHs9nhyBoBW1qvj7HQYBZUq65ftkH0wQR3LaM=' 
WHERE 
  key_id = '14a92c4602c1fda962afab0c705acfdf4e7785e40f9a0b693ed048129c7a8613' 
  AND (
    token = 'zvoh/XuHs9nhyBoBW1qvj7HQYBZUq65ftkH0wQR3LaM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027