UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vstNRkbFfeXu0Ng/QliZ06jC5rM3zExhrv/XAhsdRsc=' 
WHERE 
  key_id = '195e9007bc5d6ec47dea80c0247935820d4e0902fec2151018d04a627d2a8780' 
  AND (
    token = 'vstNRkbFfeXu0Ng/QliZ06jC5rM3zExhrv/XAhsdRsc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045