UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3CqexnY+HpaS91XUbvLE7z/YLk8mYBNIaUFTmbBWoro=' 
WHERE 
  key_id = '38b7a4b7bdce30ee3ee7a1287bf2479038d2ba7c4be3eecbe18b9079415c180e' 
  AND (
    token = '3CqexnY+HpaS91XUbvLE7z/YLk8mYBNIaUFTmbBWoro=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017