UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DTg4kh+jH0Na1i2ys06ayvSz9eL+83kAL+0Jhr5LW6M=' 
WHERE 
  key_id = '91fd38fe42bed600c0a77b201d75404a0b407b55d2412044fe953a3c32d25c79' 
  AND (
    token = 'DTg4kh+jH0Na1i2ys06ayvSz9eL+83kAL+0Jhr5LW6M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048