UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zmR/cPtHbDnq3GARZ9YHgUPVFxXb/kofXnnyEJYOKNg='
WHERE
key_id = '052deaff1a5176e2dea219850c3b765c974145be20a976a73f1e14db302e916b'
AND (
token = 'zmR/cPtHbDnq3GARZ9YHgUPVFxXb/kofXnnyEJYOKNg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)