UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Hho6WVahOtiQPahUbTRQT8pCHW+lAOBsf03hH7V7KT8=' 
WHERE 
  key_id = '450bec8cb78cda23b260b9de44c5fcd91398e1539dc0f43e0fa7fa29aaafce54' 
  AND (
    token = 'Hho6WVahOtiQPahUbTRQT8pCHW+lAOBsf03hH7V7KT8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031