UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WjZtXx+8sHthuzJEPnRGWBZsVwAeI4Ll7JZTBC4uReI='
WHERE
key_id = '445bfb396d6225e5993c78172834b1da401a5f70b1b9a4a289c325b3f4a99f28'
AND (
token = 'WjZtXx+8sHthuzJEPnRGWBZsVwAeI4Ll7JZTBC4uReI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)