UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4iw2oVGfStqEI2ipg+zumkg+8HQU164alHxXZiqD+Xo='
WHERE
key_id = 'b7a8dcaa05296f8690ef20a2e6578b8bfe44412493dbdd892c8ffe6df9954292'
AND (
token = '4iw2oVGfStqEI2ipg+zumkg+8HQU164alHxXZiqD+Xo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)