UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KfF37iUVcB6a5kxggf/Q2t7T3/gObkKz4k5KDBEkc+Q='
WHERE
key_id = 'ac751587010835b95c5f376a08cd96d69c6c4da0b24f02d6a67333ef6c742928'
AND (
token = 'KfF37iUVcB6a5kxggf/Q2t7T3/gObkKz4k5KDBEkc+Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)