UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't+GrzvAMso4jbUmr7845ZUIEa4XYTahODTuaWDxgFKc='
WHERE
key_id = '5606b08186fb82f9ef84996c00f18199867f5a97b0bf7fc4edb7379cca4e3ef3'
AND (
token = 't+GrzvAMso4jbUmr7845ZUIEa4XYTahODTuaWDxgFKc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)