UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O28CXNGmW01QDlJ5BUW3SoTAA5zP2v7hPdlofYDKia0='
WHERE
key_id = 'b34af4d68dca6f88d7dc32a647a3343700d8d46e129a65e0011991383a665501'
AND (
token = 'O28CXNGmW01QDlJ5BUW3SoTAA5zP2v7hPdlofYDKia0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)