UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GxAnfctHNYgZ09OBgmpUAbMLdVTqgGYPfwpAay4/jHs=' 
WHERE 
  key_id = '2d56570f847808519a04a5022414264eb5cea424d299160fdbad226e0d0b1c33' 
  AND (
    token = 'GxAnfctHNYgZ09OBgmpUAbMLdVTqgGYPfwpAay4/jHs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022