UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pJw1fiSAo057zgyiW2PZXpao6lkZPWqI6aNgh/rE5VA='
WHERE
key_id = '306ec9bb63ca9638f901e3b07c993a45d9401354a02223173f93bb6d0ffacf29'
AND (
token = 'pJw1fiSAo057zgyiW2PZXpao6lkZPWqI6aNgh/rE5VA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)