UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KCHoWg+u0/DoOzSEBja1de5mdiEJKFbNV1/N6o/gWqg='
WHERE
key_id = 'e026915eadb3f08265fce8b0db8d16404fc2b20f49766143c1d8d0f3c0b1fffc'
AND (
token = 'KCHoWg+u0/DoOzSEBja1de5mdiEJKFbNV1/N6o/gWqg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)