UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RR4jvzo+WQ2iKgCj/UuwkarReb4vJNkXczzK2/07nAc=' 
WHERE 
  key_id = 'bc4743621dd0b3f3c91dbb6a9afa1db61d939f9ad99ff266e75b2b964fb54871' 
  AND (
    token = 'RR4jvzo+WQ2iKgCj/UuwkarReb4vJNkXczzK2/07nAc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045