UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+6jrbhxi7kjIFxeubuTZb1MNBoKscvnAuB5KQmswhYQ='
WHERE
key_id = '1a7fc66b9ef3f5ea9db387bc505f37b60da1711703bb9c56bdc6a1da42ea17aa'
AND (
token = '+6jrbhxi7kjIFxeubuTZb1MNBoKscvnAuB5KQmswhYQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)