UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sFvOTaH+LQcc6g2WznpMgFtCaT53aklZwa/hS8egYWk='
WHERE
key_id = '5293b22e4ee2e8323a46325c46a8ee069cb139c1114ce935f461a848bdc26c48'
AND (
token = 'sFvOTaH+LQcc6g2WznpMgFtCaT53aklZwa/hS8egYWk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)