UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qpcexnhQPJSD6qDBVdmLcTZIuP3uNLS3HTwsbK8wbxc='
WHERE
key_id = '6b51a3bec55ff98bb4e201905dce89032a3c40189936730023f9f52208509685'
AND (
token = 'qpcexnhQPJSD6qDBVdmLcTZIuP3uNLS3HTwsbK8wbxc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)