UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jaVDrbdfPW6wA2TcbW+XddZwFjOtOHlC1PQYJpsboPY='
WHERE
key_id = '1a674fbdccaa04ed713ddf3dddb96745cbc407dabc21b09974289d20716af16a'
AND (
token = 'jaVDrbdfPW6wA2TcbW+XddZwFjOtOHlC1PQYJpsboPY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)