UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qBmDi28+LKx2hekq4q4VPIzjLRavGMzTJF2Zyu/dFY8='
WHERE
key_id = '898a1bd6b92e11a553d5c27be3dd2e15b8299381faf2e71857a033cc9177dd51'
AND (
token = 'qBmDi28+LKx2hekq4q4VPIzjLRavGMzTJF2Zyu/dFY8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)