UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JKqovlgHuJheIWOejXt+AU8OUpn+bBnHt2j5psxuUzI=' 
WHERE 
  key_id = '294be6b9730809dac34c5f84ba326978045ff4a00c6f6a3ba687d4b02ae2593e' 
  AND (
    token = 'JKqovlgHuJheIWOejXt+AU8OUpn+bBnHt2j5psxuUzI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026