UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5EfFOMGW5fXsyDR/hzHVKXGoQBIYYjdAm9lWT7He9bo='
WHERE
key_id = '30059b971a26a61504ca230b26f9c1816bcac0007e0830e355f9fb5901ba272a'
AND (
token = '5EfFOMGW5fXsyDR/hzHVKXGoQBIYYjdAm9lWT7He9bo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)