UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oNi0p0oCYpX0migMeQ983+qzgTjfuZdLWwx1BT0Az6s='
WHERE
key_id = '191409a3044818fafcbcb7e0b681ef8d4d02eec2d8f09a8b01cc96ed5831e437'
AND (
token = 'oNi0p0oCYpX0migMeQ983+qzgTjfuZdLWwx1BT0Az6s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)