UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rXLvF93NcgiELc+uLuXwgWcFCSymDl/+FFO1Tpno6uA=' 
WHERE 
  key_id = '45509ed91923b5b58fbec7f1b9b1dca12ef7c7aa661836f83e121d610c2944d9' 
  AND (
    token = 'rXLvF93NcgiELc+uLuXwgWcFCSymDl/+FFO1Tpno6uA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020