UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vXSGUt0oCLSijVLdeBYd+Kuq1LtYN9vBTeJ8WquZ8Sw='
WHERE
key_id = '66d67d73c438e196480f710963a7e68bcc08626889c66b0c2d8891e283b9c863'
AND (
token = 'vXSGUt0oCLSijVLdeBYd+Kuq1LtYN9vBTeJ8WquZ8Sw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)