UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IXgmRQL1dBWk7HXf2/YAWDlf/vv9zcrlj2eRZliBDW0='
WHERE
key_id = 'ff5fee6194cef8eba85033c81fb43939241f042fbeea9435bddf21d0198a3d59'
AND (
token = 'IXgmRQL1dBWk7HXf2/YAWDlf/vv9zcrlj2eRZliBDW0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)