UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tIveMS/Kthjg5fRe315zCVMZNAsozvl1XVt06pcZ6RU=' 
WHERE 
  key_id = '5489547b83bd9df5780e5c84ab923c0552ef0a78d29f25382f11fc402db6c182' 
  AND (
    token = 'tIveMS/Kthjg5fRe315zCVMZNAsozvl1XVt06pcZ6RU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060