UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '34qHEsefTpTy/AfQ3mwOb3FKRHRHBADZA7Lf3GAx5+c='
WHERE
key_id = 'edb929ac26c3e99583c9eccaa87c373b78f71da6c3cc934a2c382aff6b2d9e29'
AND (
token = '34qHEsefTpTy/AfQ3mwOb3FKRHRHBADZA7Lf3GAx5+c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)