UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9vyO4Bqnypj3rWIIVL+76UsCbp5SZwVWky7Inl7tQSI=' 
WHERE 
  key_id = '1ea081198de4e617dde62b15bc93a9456fe2fb3c4bf7030626da277ffb51e6f6' 
  AND (
    token = '9vyO4Bqnypj3rWIIVL+76UsCbp5SZwVWky7Inl7tQSI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038