UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yKTTKGyb0fEn1JdUTZxQ8WjRCZhJv4fC0JeiSRMG8RU=' 
WHERE 
  key_id = '93cfda3984f3ad49a5bdd23658f760905529fd551a92b9d09b0ad27729e12bdb' 
  AND (
    token = 'yKTTKGyb0fEn1JdUTZxQ8WjRCZhJv4fC0JeiSRMG8RU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025