UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '01W9BfSNJ0PoFoEI9PS8angLlI4TMLd3v/cb2O9n6wQ='
WHERE
key_id = 'b0a3eb51455d61aff0a96035335d10ac860e3185bd1bcb824f299a9fa30e4ce2'
AND (
token = '01W9BfSNJ0PoFoEI9PS8angLlI4TMLd3v/cb2O9n6wQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)