UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EoNbP5UY/oKU3MokbTYRVzi6pMX0/seG5cHNKlGxp0M='
WHERE
key_id = '6f2d667e0e016840724efb9ff529a36316afcfc2222b3cdf9a7ccd1c925f0826'
AND (
token = 'EoNbP5UY/oKU3MokbTYRVzi6pMX0/seG5cHNKlGxp0M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)