UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6v5DGNDlarg/FvImYVtoELtE1UQ3JM8TZoB8t0C0pdc='
WHERE
key_id = 'd5d36f844d7fccd5e14a03c6163e7364bb50e636968f73cd50993e03586d1f4e'
AND (
token = '6v5DGNDlarg/FvImYVtoELtE1UQ3JM8TZoB8t0C0pdc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)