UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yRKrmRQ52QP/IaLFkXKx21tcGcAEDWEq3Ukc8nML3AE=' 
WHERE 
  key_id = '621c777a78445d4b7e1595347b0e8dd80ee8e714b56e40d9c4e60d38dbff5885' 
  AND (
    token = 'yRKrmRQ52QP/IaLFkXKx21tcGcAEDWEq3Ukc8nML3AE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031