UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CQvoBkXyB53FdmLiMh75aPtqNHEtDUmm0HYrsSql/+g='
WHERE
key_id = 'adf80428085a8e80c3d7d2a61de4f569766a89ea3f52d3e2b42759f0e91b26d2'
AND (
token = 'CQvoBkXyB53FdmLiMh75aPtqNHEtDUmm0HYrsSql/+g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)