UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'i7sp4j3NvGnSmcb4AsTKcUgYwfiAR7t7EZONncddmFc=' 
WHERE 
  key_id = '53f50ed1f6374cc7b04ade670d781c29caa7b5c4384ec53f0ba691a2df09e873' 
  AND (
    token = 'i7sp4j3NvGnSmcb4AsTKcUgYwfiAR7t7EZONncddmFc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022