UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qSAEuZrf8hB6bkm2MfLJlbk5+lukSLISzRKenwDCK8g='
WHERE
key_id = '897242ec49ee3c147baa38940a9d00b520ab7a7d8776f356f09a8a0cd6f777fc'
AND (
token = 'qSAEuZrf8hB6bkm2MfLJlbk5+lukSLISzRKenwDCK8g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)