UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yxWJs4Is7VbFN5OCbCXgzj7z8pgXEnWlpj/bjXpg2PE=' 
WHERE 
  key_id = 'e21593896df76afc4a7ec9638067ab4b8483aab76eda9696e099c44aa78610bf' 
  AND (
    token = 'yxWJs4Is7VbFN5OCbCXgzj7z8pgXEnWlpj/bjXpg2PE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022