UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's1TFizJLJpboF5o6IQTfYKeTWQEPpt34lrkMi6uARwI=' 
WHERE 
  key_id = 'f67addce2bc66efcda91f03c5b45cf0b1a7450702e94635b4245ad4bdbf70b83' 
  AND (
    token = 's1TFizJLJpboF5o6IQTfYKeTWQEPpt34lrkMi6uARwI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030