UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SztlGWcj7Cy0DvL9cmNXuuDye4cURrPbBrpXFNtOrFM=' 
WHERE 
  key_id = 'e1ccd0d70470caa9c716e3b1dbede420c5f8d1e164f38fc89b379bdcdfccfd99' 
  AND (
    token = 'SztlGWcj7Cy0DvL9cmNXuuDye4cURrPbBrpXFNtOrFM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029