UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1qhRAQQRlbItfYyLwoy/V9GOHu4fDAjbgPsCnev+MsE='
WHERE
key_id = 'd27f7627fd372787275ffaab62914ffab410f3957bab02292c1ef0c079e5b6dd'
AND (
token = '1qhRAQQRlbItfYyLwoy/V9GOHu4fDAjbgPsCnev+MsE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)