UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gMGs3IVlqK9KaTpmkN+CDnHsdwwa2snn2ULGyoP2mAw=' 
WHERE 
  key_id = '22ab2452a532b15965f3057d9fbc636c08ff4205940fc0b91aabf01e94a27b42' 
  AND (
    token = 'gMGs3IVlqK9KaTpmkN+CDnHsdwwa2snn2ULGyoP2mAw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030