UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fSYq6mwPg4tt8pF0xoQhtHiNARfQ5GxqbQFMJe17WlM='
WHERE
key_id = '812c084bad3d29628d44f9f3005c46ed074b6bc330d57b2aa482fa3cac7f8b93'
AND (
token = 'fSYq6mwPg4tt8pF0xoQhtHiNARfQ5GxqbQFMJe17WlM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)