UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DsevEww9U9SULclfX7o12s6ir+lziSSzAStcR6DkAdE=' 
WHERE 
  key_id = '23be41b1506d96e13f435c7250f7e779828982bee172d1445c0dcdf751b8e087' 
  AND (
    token = 'DsevEww9U9SULclfX7o12s6ir+lziSSzAStcR6DkAdE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026