UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '81XFGiy29nPfFfDv4dPEAVp95CSfLuIW431fkJ30Zi0='
WHERE
key_id = '9423c83a79d468007fc7d3fdb9f50cfe3569304d70dea9104042468672bafcc8'
AND (
token = '81XFGiy29nPfFfDv4dPEAVp95CSfLuIW431fkJ30Zi0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)