UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wlrqJQDE7b2NMIljuFzxoDljp75qLnr+hSD6IZ6ZEp0='
WHERE
key_id = 'a8abb60e601178186a11d7a71216996ea6cf746312b2ca78e84a88fb47c16a2f'
AND (
token = 'wlrqJQDE7b2NMIljuFzxoDljp75qLnr+hSD6IZ6ZEp0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)