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