UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EaG4IFj3TozhagfD301c0/J7dlbnJydONAbQeLzIVpg='
WHERE
key_id = 'a1b43672ab0467b26b7a05174e25996db5ba3276ad90a7bf4332d94442274998'
AND (
token = 'EaG4IFj3TozhagfD301c0/J7dlbnJydONAbQeLzIVpg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)