UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/hzhDDlhGagbPAjGe9Gsqr2AGmHtB6VALVQwajppP0w=' 
WHERE 
  key_id = '1c151915136c1bda73b5ce724c6a7b0ebe1f4b90bf4d625ded680675cd59e2c0' 
  AND (
    token = '/hzhDDlhGagbPAjGe9Gsqr2AGmHtB6VALVQwajppP0w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038