UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3mFS9vwT6LB5Vv1cLTftB/QwAmoGSGezmBQAVSebHEM='
WHERE
key_id = '509c58cf9ce47d7c28331d7184c79495d26865b3708a386754c3f650814f7fe5'
AND (
token = '3mFS9vwT6LB5Vv1cLTftB/QwAmoGSGezmBQAVSebHEM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)