UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pXEn/TTYyTGP4TiBu2DaaojEKsh9hFyteULz0Dmx4hI='
WHERE
key_id = '2261a53e144de70b4338d9a75c46cd001745c856a97afb91873f79a7ca625f86'
AND (
token = 'pXEn/TTYyTGP4TiBu2DaaojEKsh9hFyteULz0Dmx4hI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)