UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AF9BIlXV97hQolc8PqgnX5xbgcuOaaQ5MDPuietzjbk=' 
WHERE 
  key_id = '3051fecc82194ec6bb0db48f1400aa0175f0a8fe15ce31be08c68d8018ab27a9' 
  AND (
    token = 'AF9BIlXV97hQolc8PqgnX5xbgcuOaaQ5MDPuietzjbk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030