UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EPeixC3p65b1yJ1eNheyringib4YCIdSulvIqDX8kK4='
WHERE
key_id = '0877a04a3c7c101cdc9c20d1642046251adfa0a0dba6f1dfc9c011dbdbdbf607'
AND (
token = 'EPeixC3p65b1yJ1eNheyringib4YCIdSulvIqDX8kK4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)